package xing.domain.page;

import com.querydsl.core.types.dsl.BooleanPath;
import xing.domain.page.dto.ModuleItemDto;
import xing.infrastructure.data.EntityBase;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Entity
@Table(name="page_module")
public class PageModule  implements Comparable<PageModule>, Serializable {
  private Long id;
  private Long templateid;
  private String name;
  private String type;
  private Long level;
  private String showtype;
  private Long sort;
  private String padding;
  private String backcolor;
  private Boolean titleisshow;
  private String titlecolor;
  private String titlebackcolor;
  private String companycode;
  private String version;
  private java.sql.Timestamp created;

  public PageModule(){}

  public PageModule(long id,long sort){
    this.id=id;
    this.sort=sort;
  }

    private List<ModuleItemDto> moduleItems=new ArrayList<>();
  @Transient
  public List<ModuleItemDto> getModuleItems() {
    return moduleItems;
  }

  public void setModuleItems(List<ModuleItemDto> modules) {
    this.moduleItems = modules;
  }

  @Id
  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getTemplateid() {
    return templateid;
  }

  public void setTemplateid(Long templateid) {
    this.templateid = templateid;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public Long getLevel() {
    return level;
  }

  public void setLevel(Long level) {
    this.level = level;
  }

  public String getShowtype() {
    return showtype;
  }

  public void setShowtype(String showtype) {
    this.showtype = showtype;
  }

  public Long getSort() {
    return sort;
  }

  public void setSort(Long sort) {
    this.sort = sort;
  }

  public String getPadding() {
    return padding;
  }

  public void setPadding(String padding) {
    this.padding = padding;
  }

  public String getBackcolor() {
    return backcolor;
  }

  public void setBackcolor(String backcolor) {
    this.backcolor = backcolor;
  }

  public Boolean getTitleisshow() {
    return titleisshow;
  }

  public void setTitleisshow(Boolean titleisshow) {
    this.titleisshow = titleisshow;
  }

  public String getTitlecolor() {
    return titlecolor;
  }

  public void setTitlecolor(String titlecolor) {
    this.titlecolor = titlecolor;
  }

  public String getTitlebackcolor() {
    return titlebackcolor;
  }

  public void setTitlebackcolor(String titlebackcolor) {
    this.titlebackcolor = titlebackcolor;
  }

  public String getCompanycode() {
    return companycode;
  }

  public void setCompanycode(String companycode) {
    this.companycode = companycode;
  }

  public String getVersion() {
    return version;
  }

  public void setVersion(String version) {
    this.version = version;
  }

  public java.sql.Timestamp getCreated() {
    return created;
  }

  public void setCreated(java.sql.Timestamp created) {
    this.created = created;
  }

  @Override
  public int compareTo(PageModule o) {
    return this.sort.compareTo(o.sort);
  }
}
